package com.lambkit.module.cms.common;

import com.lambkit.common.LambkitResult;

/**
 * cms系统常量枚举类
 * Created by shuzheng on 2017/2/19.
 */
public class CmsResult extends LambkitResult {

    public CmsResult(CmsResultConstant cmsResultConstant, Object data) {
        super(cmsResultConstant.getCode(), cmsResultConstant.getMessage(), data);
    }
    
    public CmsResult(CmsResultConstant cmsResultConstant, String message, Object data) {
        super(cmsResultConstant.getCode(), message, data);
    }

    public static CmsResult by(CmsResultConstant cmsResultConstant, Object data) {
    	return new CmsResult(cmsResultConstant, data);
    }
    
    public static CmsResult success(Object data) {
    	return new CmsResult(CmsResultConstant.SUCCESS, data);
    }
    
    public static CmsResult fail() {
    	return new CmsResult(CmsResultConstant.FAILED, null);
    }
    
    public static CmsResult fail(String message) {
    	return new CmsResult(CmsResultConstant.FAILED, message, null);
    }
}
